﻿@using Nop.Plugin.Shipping.FixedByWeightByTotal.Models
@using Nop.Web.Framework.Models.DataTables
<div class="panel-group basic-setting">
    <div class="panel panel-default">
        <div class="panel-body">
            @await Html.PartialAsync("Table", new DataTablesModel
            {
                Name = "shipping-rate-grid",
                UrlRead = new DataUrl("FixedShippingRateList", "FixedByWeightByTotal", null),
                UrlUpdate = new DataUrl("UpdateFixedShippingRate", "FixedByWeightByTotal", null),
                Length = Model.PageSize,
                LengthMenu = Model.AvailablePageSizes,
                ColumnCollection = new List<ColumnProperty>
                {
                    new ColumnProperty(nameof(FixedRateModel.ShippingMethodName))
                    {
                        Title = T("Plugins.Shipping.FixedByWeightByTotal.Fields.ShippingMethod").Text
                    },
                    new ColumnProperty(nameof(FixedRateModel.Rate))
                    {
                        Title = T("Plugins.Shipping.FixedByWeightByTotal.Fields.Rate").Text,
                        Width = "200",
                        Editable = true,
                        EditType = EditType.Number	 
                    },
                    new ColumnProperty(nameof(FixedRateModel.TransitDays))
                    {
                        Title = T("Plugins.Shipping.FixedByWeightByTotal.Fields.TransitDays").Text,
                        Width = "200",
                        Editable = true,
                        EditType = EditType.Number	 
                    },
                    new ColumnProperty(nameof(FixedRateModel.ShippingMethodId))
                    {
                        Title = T("Admin.Common.Edit").Text,
                        Width = "200",
                        ClassName =  NopColumnClassDefaults.Button,
                        Render = new RenderButtonsInlineEdit()
                    }
                }
            })
        </div>
    </div>
</div>